﻿using System.Globalization;
using System.Windows.Data;

namespace DesktopToyWpf.Convertors;

public class HappyCountConvertor : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is int intValue)
        {
            return intValue > 99 ? "99+" : $"x{intValue:00}";
        }

        return value;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotSupportedException();
    }
}